package com.magic.gre.ui.dialog;

import android.os.Bundle;
import android.view.View;

import com.magic.gre.R;
import com.magic.gre.base.dialog.BaseBottomDialog;


/**
 * Author: Lmoumou
 * Date: 2018-12-17 15:30
 * 文件名: ChoosePicDialog
 * 描述:
 */
public class ChoosePicDialog extends BaseBottomDialog {

    private OnChooseDialogListener onChooseDialogListener;

    public void setOnChooseDialogListener(OnChooseDialogListener onChooseDialogListener) {
        this.onChooseDialogListener = onChooseDialogListener;
    }

    @Override
    protected int setViewId() {
        return R.layout.dialog_choose_pic;
    }

    @Override
    protected void initView(View view) {
        view.findViewById(R.id.photograph_tv).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onChooseDialogListener != null) {
                    dismissThis(isResumed());
                    onChooseDialogListener.onPhotograph();
                }
            }
        });

        view.findViewById(R.id.album_tv).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                if (onChooseDialogListener != null) {
                    dismissThis(isResumed());
                    onChooseDialogListener.onAlbum();
                }
            }
        });
    }

    @Override
    protected void initBundle(Bundle bundle) {

    }

    public interface OnChooseDialogListener {
        void onPhotograph();

        void onAlbum();
    }
}
